package xiao_jin.fantastic_journey.core.init;

import net.minecraft.block.Block;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import xiao_jin.fantastic_journey.FantasticJourney;
import xiao_jin.fantastic_journey.core.common.block.entity.relictechblock.RelictechTableBlockEntity;
import xiao_jin.fantastic_journey.util.ModUtil;

public final class ModBlockEntity {
    public static final BlockEntityType<RelictechTableBlockEntity> RELICTECH_TABLE_BLOCK_ENTITY = register("ruin_table_entity", RelictechTableBlockEntity::new, ModBlocks.RELICTECH_TABLE);

    public static void registerBlockEntityTypes() {
    }

    private static <T extends BlockEntity> BlockEntityType<T> register(String name, BlockEntityType.BlockEntityFactory<T> entity, Block... blocks) {
        return Registry.register(Registries.BLOCK_ENTITY_TYPE, ModUtil.getIdOfMod(name),
                BlockEntityType.Builder.create(entity, blocks).build(null));
    }
}